import React, { memo } from 'react'
import { Button } from 'antd'

interface Props {
    onClickButton: Function
    children?: any
}

const Children = (props: Props) => {
    const { onClickButton, children  } = props
    return (
        <div>
            <Button type="primary" onClick={onClickButton}>{children}</Button>
            <span style={{margin: 20}}>{Math.random()}</span>
        </div>
    ) 
}

export default memo(Children) 



// class Children extends React.PureComponent<Props> {
//     render() {
//         const { props } = this;
//         console.log('Children render props.value ===> ', props.value)
//         return (
//             <div>
//                 <div>{props.value}</div>
//             </div>
//         );
//     }
// }

// export default Children